package leeon.forpeddy;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FilenameFilter;
import java.io.IOException;

public class PrintHelper {
	
	public static final String BASE_DIR = "D:\\project\\eurospace\\forpeddy\\misc\\";
	
	public static void main(String[] a) throws IOException {
		File file = new File(BASE_DIR);
		if (file.isDirectory()) {
			File[] fs = file.listFiles(new FilenameFilter() {
				public boolean accept(File dir, String name) {
					return name.endsWith(".html");
				}				
			});
			System.out.println("#IMAGE_TYPE=JPG");
			for (File f : fs) {
				FileInputStream fis = new FileInputStream(f);
				byte[] bts = new byte[fis.available()];
				fis.read(bts);
				fis.close();
				
				String bs = new String(bts);
				bs = bs.replace("#C2C0CB", "").replace("color:green;line-height:20pt;FILTER: glow(color=white,strength=0) shadow(color=gray,direction=145); POSITION: relative; WIDTH: 100%", "");
				FileOutputStream fos = new FileOutputStream(f);
				fos.write(bs.getBytes());
				fos.flush();
				fos.close();
				
				
				String out = BASE_DIR + 
							"pic\\" +
							f.getName().substring(0, f.getName().lastIndexOf(".")) +
							"|" +
							BASE_DIR +
							f.getName();
				System.out.println(out);
			}
		}
	}

}
